﻿<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link href="./Public/Admin/Css/public.css" rel="stylesheet" type="text/css" />
<title>文章管理</title>
	<script>
		function confirmDel(id){
			if(window.confirm("确认要删除吗？")) {
				location.href="?c=Article&a=delete&id="+id;
			}
		}
	</script>
</head>

<body>
<!--导航栏-->
<table width="100%" border="0" align="center" cellpadding="1" cellspacing="1" class="border">
	<tr class="topbg"><td>文章管理</td></tr>
	<tr class="tdbg">
		<td height="30">&nbsp;&nbsp;
			<a href="?c=Article&a=index">管理首页</a>&nbsp;|&nbsp;
			<a href="?c=Article&a=add">添加文章</a>
		</td>
	</tr>
</table>

<!--搜索表单-->
<div style="padding:8px 5px;margin:8px 3px;background-color:#fefefe;text-align:center;">
	<form action="admin.php?c=Article&a=index" method="post" name="form1">
	<select name="category_id">
		<option value="">任意</option>
		<{foreach $categorys as $category }>
			<option value="<{$category['id']}>"> <{str_repeat('--', $category['level']*4)}><{$category['classname']}></option>
		<{/foreach}>
	</select>
	<span style="padding:0px 5px;">状态</span>
	<select name="status">
		<option value="">任意</option>
		<option value="1">公开</option>
		<option value="2">草稿</option>
		<option value="3">隐藏</option>
	</select>
	<span style="padding:0px 5px;">置顶</span>
	<input type="checkbox" name="top" value="1">
	<span style="padding:0px 5px;">标题</span>
	<input type="text" name="keyword" />
	<input type="submit" value="搜索" />
	<input type="hidden" name="ac" value="search" />
</form>
</div>

<!--文章列表-->
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="border">
<tr class="title" align="center">
	<td>编号</td>
	<td>分类</td>
	<td>标题</td>
	<td>作者</td>
	<td>状态</td>
	<td>发布时间</td>
	<td>操作选项</td>
</tr>
<{foreach $articles as $article}>
<tr class="tdbg" align="center">
	<td><{$article['id']}></td>
	<td><{$article['classname']}></td>
	<td align="left"><a target="_blank" href="#"><{$article['title']}></a></td>
	<td><{$article['username']}></td>
	<td>
		<!--<?php-->
		<!--switch($article['status'])-->
		<!--{-->
			<!--case 1:-->
				<!--echo "公开";-->
				<!--break;-->
			<!--case 2:-->
				<!--echo "草稿";-->
				<!--break;-->
			<!--case 3:-->
				<!--echo "隐藏";-->
				<!--break;-->
		<!--}-->
		<!--?>-->
	</td>
	<td>
		<!--<?php echo date("Y-m-d H:i",$article['addate'])?>-->
		<{$article['addate']}>
	</td>
	<td>
		<a href="?c=Article&a=edit&id=<?php echo $article['id']?>">修改</a> | 
		<a href="#" onclick="confirmDel( <{$article['id']}>)"> 删除 </a>
	</td>
</tr>
<{/foreach}>

<!--文章分页-->
<tr class="tdbg">
	<td colspan="7" align="center"><{$pageStr}></td>
</tr>
</table>
</body>
</html>
